{include file="common/_header"}
{include file="common/_header1"}
<style>
    .layui-form {
        display: flex;
        flex-direction: column;
        width: 700px;
        padding: 10px 20px 0 0;
        margin: 20px auto;
    }

    .layui-form input[readonly] {
        background-color: #fff !important;
    }

    .layui-form-label {
        width: auto;
    }

    .layui-form-select dl dd.layui-this,
    .layui-laydate .layui-this {
        background-color: #459cfc !important;
    }

    .layui-form-checkbox i {
        height: 30px;
    }

    .layui-form-switch i {
        top: 2px;
    }

    .layui-form-radio * {
        font-size: 22px;
    }

    .layui-form-radio:hover *,
    .layui-form-radioed,
    .layui-form-radioed>i {
        color: #6faed9;
    }

    .layui-upload-list {
        display: inline;
    }

    .layui-upload-img {
        max-width: 200px;
        border: 0 !important;
        border-radius: 10px;
    }

    .label-c {
        display: flex;
        justify-content: center;
        text-align: center;
        margin: 0 auto 50px;
    }

    .label-c label {
        font-size: 30px;
        font-weight: 500;
    }
</style>

<body class="no-skin">
<div class="main-container" id="main-container">
    <div class="">
        <form class="layui-form" method="post" action="">
            <div class="layui-form-item">
                <input type="hidden" name="handle" value="save1" />
                <input type="hidden" name="product_id" value="{$data.get['product_id']}" />
                <input type="hidden" name="p_s_id" value="{$data.get['p_s_id']}" />
            </div>
            <div class="layui-form-item label-c">
                <label class="layui-form-label">添加订单</label>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">金额</label>
                <div class="layui-input-block">
                    <input type="number" name="pay_amount" required lay-verify="required" placeholder="请输入金额" autocomplete="off" class="layui-input" value="">
                </div>
            </div>
        </form>
    </div>
</div>
<script src="/static/admin/lib/layui/layui2.js" charset="utf-8"></script>
<script type="text/javascript">
    // layui.use(['form', 'upload', 'layarea', 'laydate', 'element', 'layer'], function () {
    layui.use(['form', 'upload', 'laydate', 'element', 'layer'], function () {
        var form = layui.form
            // , layarea = layui.layarea
            , laydate = layui.laydate
        //监听提交
        form.on('submit(formDemo)', function (data) {
            $.ajax({
                url: 'shopinfo',
                type: 'post',
                async:false,
                dataType: 'json',
                data: data.field,
                success: function (data) {
                    // console.log(data);
                    if(data.code != 0){
                        layer.msg(data.msg, {
                            icon: 6,
                            time: 500,
                        }, function () {
                            window.location.reload();
                        })
                    } else {
                        // console.log(345);
                        layer.msg(data.msg, {
                            icon: 5,
                            time: 500,
                        }, function () {
                        })
                    }
                },
                error: function(data){
                    console.log(data);
                    console.log(111);
                }
            })
        });
        // layarea.render({
        //     elem: '#area-picker',
        //     change: function (res) {
        //         // 选择结果res
        //     }
        // });
        //时间范围
        laydate.render({
            elem: '.time_range'
            ,type: 'time'
            ,range: true
            ,format: 'HH:mm'
        });
    });
</script>
<script>

</script>
</body>
{include file="common/_bottom"}